/*
 * (C)opyright 2012 ssb Software Service und Beratung GmbH
 */
package net.slidinglive.utilities.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

/**
 * @author Sebastian Hoffmann <bo.hoffi@gmail.com>
 */
public abstract class AbstractFragment
        extends Fragment {

    protected ViewGroup view;
    private int layoutId;
    private String title;

    protected AbstractFragment() {

    }

    public AbstractFragment(final int layoutId, final String title) {

        this.layoutId = layoutId;
        this.title = title;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        this.view = (ViewGroup) inflater.inflate(this.layoutId, container, false);

        this.prepareView();

        return this.view;
    }

    public String getTitle() {

        return this.title;
    }

    public void setTitle(final String title) {

        this.title = title;
    }

    protected abstract void prepareView();
}